<? if(!defined('IN_FANWE')) exit('Access Denied'); 
0
|| checkTplRefresh('./tpl/huaban/page/u/u_message.htm', './tpl/huaban/inc/pages.htm', 1357441554, './data/tpl/compiled/page_u_u_message.tpl.php', './tpl/huaban', 'page/u/u_message')
;?>
<?php 
$css_list[0]['url'][] = './tpl/css/zone.css';
$js_list[0] = './tpl/js/zone.js';
 include template('inc/header'); ?><div id="body" class="fm960">
<div class="homens_hd"></div>
<div class="homens_bd clearfix">
<div id="content" class="clearfix" style="width:960px;"><? include template('inc/u/u_menu'); ?>            <div id="maincolumn">
            	<div id="friend">
                	<h1>消息</h1>
                    <div class="ftag">
<ul class="cf">
<li class="current"><a href="/notification">私信</a></li>
</ul>
</div>
                    <div class="infotable" id="sys_msgs">
                    	<? if(empty($sys_notices) && empty($sys_msgs) && empty($msg_list)) { ?>
                        <span id="span-page">
<div class="fr_nocontent_tips">还没有收到通知</div>
</span>
                        <? } else { ?>
                        <div class="cut cf">
<span id="notify_display"  class="f14 gray">共有<em id="jquery-num"><?=$count?></em>条私信</span>
</div>
                        <ul id="noticelist" class="noticelist">
                        <? if(is_array($sys_msgs)) { foreach($sys_msgs as $msg) { ?>                        	<li class="cf">
                            	<div class="select">
                            		<input type="checkbox" value="<?=$msg['mid']?>" name="mid" class="mid">
                                </div>
                                <div class="uhead">
                                	<img src="./tpl/images/head_30.jpg" />
                                </div>
                                <div class="usay">
                                	系统消息:
                                	<a href="<?php echo FU('u/msgview',array("mid"=>$msg['mid'])); ?>"><?=$msg['title']?></a>
                                    <span class="gray">&nbsp;<?php echo getBeforeTimelag($msg['create_time']); ?></span>
                                </div>
                            </li>
                            <? } } ?>
                            
                            <? if(is_array($sys_notices)) { foreach($sys_notices as $notice) { ?>                        	<li class="cf">
                            	<div class="select">
                            		<input type="checkbox" value="<?=$notice['id']?>" name="nid" class="nid">
                                </div>
                                <div class="uhead">
                                	<img src="./tpl/images/head_30.jpg" />
                                </div>
                                <div class="usay">
                                	系统通知:
                                    <a href="<?php echo FU('u/msgview',array("nid"=>$notice['id'])); ?>"><?=$notice['title']?></a>
                                    <span class="gray">&nbsp;<?php echo getBeforeTimelag($msg['create_time']); ?></span>
                                </div>
                            </li>
                            <? } } ?>
                            <? if(is_array($msg_list)) { foreach($msg_list as $msg) { ?>                        		<li class="cf" href="<?php echo FU('u/msgview',array("lid"=>$msg['mlid'])); ?>" mlid="<?=$msg['mlid']?>">
                                	<div class="select">
                            			<input type="checkbox" value="<?=$msg['mlid']?>" name="mlid" class="mlid">
                                	</div>
                                	<div class="uhead">
                                        <a href="<?=$msg['msg_tuser']['url']?>"><img src="<?php echo avatar($msg['tuid'],'s',1);?>" height="30" width="30" /></a>
                                    </div>
                                    <div class="usay">
                                    	<p class="f14"> 
                                        <? if($msg['last_uid'] == $_FANWE['uid']) { ?>
我 ：
<? } else { ?>
<a href="<?=$msg['msg_tuser']['url']?>"><?=$msg['msg_tuser']['user_name']?></a>：
<? } ?>
                                            <a href="<?php echo FU('u/msgview',array("lid"=>$msg['mlid'])); ?>" class="blue"><?=$msg['last_msg']?></a>
                                        </p>
                                        <p class="gray datatime">
                                        	<span class="floatright">
                                            	<a href="<?php echo FU('u/msgview',array("lid"=>$msg['mlid'])); ?>" class="blue">
                                                	<em class="blue">共<?=$msg['num']?>封</em>
                                                </a>  
                                                <? if($msg['last_uid'] != $_FANWE['uid']) { ?>
|<a href="<?php echo FU('u/msgview',array("lid"=>$msg['mlid'])); ?>" class="blue">回复</a>
<? } ?>
                                            </span>
                                            <?=$msg['time']?>
                                       </p>
                                   </div>
                               </li>
                            <? } } ?>
                        </ul>
                        <? } ?>
                    </div>
                    <div class="cf">
<div id="jquery-select" style="float:right">
<span id="all_del_btn" style="display:''" class="floatright">
                            	<a href="javascript:;" class="all" id="selectMsgAll">全选</a> | 
                                <a href="javascript:;" class="delete" id="removeMsg">删除</a>
                            </span>
</div>
</div>
<div class="pagination"><? if($pager['page_count'] > 1) { ?>
<div class="pages">
<? if($pager['page'] > 1) { ?>
<a href="<?=$pager['page_prev']?>" class="page_prev" page="<?=$pager['prev_page']?>">&lt;上一页</a>
<? } if(is_array($pager['page_nums'])) { foreach($pager['page_nums'] as $page_num) { if($pager['page'] == $page_num['name']) { ?>
<a class="c"><?=$page_num['name']?></a>
<? } elseif($page_num['name'] == '...') { ?>
<i>...</i>
<? } else { ?>
<a href="<?=$page_num['url']?>" page="<?=$page_num['name']?>"><?=$page_num['name']?></a>
<? } } } if($pager['page'] < $pager['page_count']) { ?>
<a href="<?=$pager['page_next']?>" class="page_next" page="<?=$pager['next_page']?>">下一页&gt;</a>
<? } ?>
</div>
<? } ?> 
</div>
                </div>
            </div>
</div>
</div>
<div class="homews_ft"></div>
</div>
<script type="text/javascript">
var check_s = 1;
jQuery(function($){

$(".msg_list li input").click(function(event){
event.stopPropagation();
});

$("#selectMsgAll").click(function(){
if(check_s == 1)
{
$(".mlid").attr('checked',true);
$(".mid").attr('checked',true);
$(".nid").attr('checked',true);
check_s = 0;
}
else
{
$(".mlid").attr('checked',false);
$(".mid").attr('checked',false);
$(".nid").attr('checked',false);
check_s = 1;
}
});

$("#removeMsg").click(function(){
var mlids = new Array();
$(".mlid:checked").each(function(){
mlids.push(this.value);
});

var mids = new Array();
$(".mid:checked").each(function(){
mids.push(this.value);
});

var nids = new Array();
$(".nid:checked").each(function(){
nids.push(this.value);
});

if(mlids.length > 0 || mids.length > 0 || nids.length > 0)
{
$("#removeMsg").attr('disabled',true);
var query = new Object();
query.mlid = mlids.join(",");
query.mid = mids.join(",");
query.nid = nids.join(",");

$.ajax({
url: SITE_PATH+"services/service.php?m=user&a=removemsg",
type: "POST",
data:query,
dataType: "json",
success: function(result){
for(var mlid in result.mlid)
{
if(result.mlid[mlid] > 0)
{
$(".msg_list li[mlid='"+ mlid +"']").remove();	
}
}

for(var mid in result.mid)
{
if(result.mid[mid] > 0)
{
$(".msg_list li[mid='"+ mid +"']").remove();	
}
}

for(var nid in result.nid)
{
if(result.nid[nid] > 0)
{
$(".msg_list li[nid='"+ nid +"']").remove();	
}
}

if($(".msg_list li").length == 0)
{
location.reload(true);
}
},
error:function(){
alert('删除信件失败，请稍候重新删除');
$("#removeMsg").attr('disabled',false);
}
});
}
});
});
</script><? include template('inc/footer'); ?>